<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <title>预审</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8"/>
    <link rel="stylesheet" href="${re.contextPath}/plugin/layui/css/layui.css">

</head>

<style>
    .layui-form-radio{
        font-size:12px !important;

    }
    #serviceTypeId {
        width:200px;
    }

</style>
<body>
<form id="subform" class="layui-form" name="itemForm" action="" method="post">

    <div class="layui-form-item">
        <fieldset class="layui-elem-field layui-field-title" style="margin-top: 10px;">
            <legend style="font-size:16px;">预审信息</legend>
        </fieldset>
    </div>
    <div class="layui-form-item">
        <input type="hidden" id="id" name="id" value="${capPreApproval.id}"/>
        <div class="layui-inline">
            <label for="serviceTypeId" class="layui-form-label">
                业务类型
            </label>
            <div class="layui-input-inline" id="serviceTypeId" >

            </div>

        </div>
        <div class="layui-inline">
            <label for="serviceKindId" class="layui-form-label">
                业务分类
            </label>
            <div class="layui-input-inline">
               <select name="serviceKindId" id="serviceKindId"  lay-filter="serviceKind" lay-search></select>
            </div>

        </div>
        <div class="layui-inline">
            <label for="serviceId" class="layui-form-label">
                业务名称
            </label>
            <div class="layui-input-inline" >
                <select name="serviceId" id="serviceId"  lay-filter="serviceId" lay-search></select>
            </div>
            <input type="hidden" name="serviceId" id="serviceIdHidden" value="${capPreApproval.serviceId}">
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label for="filler" class="layui-form-label">
                填报人
            </label>
            <div class="layui-input-inline">
                <input type="text" id="filler" name="filler" lay-verify="filler" style="width:200px"
                       autocomplete="off" class="layui-input" value="${capPreApproval.filler}"/>
            </div>

        </div>
     <div class="layui-inline">
         <label for="phone" class="layui-form-label">
             电话
         </label>
         <div class="layui-input-inline">
             <input type="text" id="phone" name="phone" lay-verify="phone"
                    autocomplete="off" class="layui-input" value="${capPreApproval.phone}"/>
         </div>
     </div>
    </div>
    <div class="layui-form-item" style="display:none" id="companyApproval">
        <div class="layui-inline">
            <label for="companyName" class="layui-form-label">
                企业名称
            </label>
            <div class="layui-input-inline" style="width:200px">
                <input type="text" id="companyName" name="companyName" lay-verify="companyName"
                       autocomplete="off" class="layui-input" value="${capPreApproval.companyName}"/>
            </div>

        </div>
        <div class="layui-inline">
            <label for="creditCode" class="layui-form-label">
                企业信用代码
            </label>
            <div class="layui-input-inline">
                <input type="text" id="creditCode" name="creditCode" lay-verify="creditCode"
                       autocomplete="off" class="layui-input" value="${capPreApproval.creditCode}"/>
            </div>

        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-inline">
            <label for="approvalNumber" class="layui-form-label">
                预审编号
            </label>
            <div class="layui-input-inline" style="width:200px">
                <input type="text" id="approvalNumber" name="approvalNumber" lay-verify="approvalNumber"
                       autocomplete="off" class="layui-input" value="${capPreApproval.approvalNumber}" readonly/>
            </div>
        </div>
    </div>

    <div class="layui-form-item">
        <fieldset class="layui-elem-field layui-field-title" style="margin-top: 10px;">
            <legend style="font-size:16px;">预审材料</legend>
        </fieldset>
    </div>
    <div class="layui-form-item" id="documentList">

    </div>
    <div style="display:none" id="approvalResultInfo" >
    <div class="layui-form-item">
        <fieldset class="layui-elem-field layui-field-title" style="margin-top: 10px;">
            <legend style="font-size:16px;">预审结果</legend>
        </fieldset>
    </div>
    <div class="layui-form-item">

    <div class="layui-inline">
        <div class="layui-inline">
        <label for="approvalResult" class="layui-form-label">
            预审结果
        </label>
        <div class="layui-input-inline" id="approvalResult" style="width:300px">

        </div>
            <input type="hidden" name="approvalResult" id="approvalResultHidden">
    </div>

    </div>
        <div class="layui-form-item">
        <div class="layui-inline" style="display:none;" id="handleTypeInline">
            <div class="layui-inline">
                <label for="handleType" class="layui-form-label">
                    办理方式
                </label>
                <div class="layui-input-inline" id="handleType" style="width:400px">

                </div>

            </div>

        </div>
        </div>
        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label" for="approvalSuggestion">预审意见</label>
            <div class="layui-input-block" style="width:80%">
                <textarea placeholder="请输入预审意见" class="layui-textarea" id="approvalSuggestion" name="approvalSuggestion">${capPreApproval.approvalSuggestion}</textarea>
            </div>
        </div>
        <div class="layui-form-item">
            <fieldset class="layui-elem-field layui-field-title" style="margin-top: 10px;">
                <legend style="font-size:16px;">预审历史意见</legend>
            </fieldset>
        </div>
        <div class="layui-form-item" id="suggestionList">

        </div>
    </div>
    </div>
    <div class="layui-from-item">
        <div style="text-align:center">
            <#if (detail!="readonly" )>
<!--              <#if (capPreApproval.approvalStatus==null || capPreApproval.approvalStatus =='1' || capPreApproval.approvalStatus=='2')>-->
<!--                <button class="layui-btn layui-btn-normal" lay-filter="save" lay-submit="">-->
<!--                    保存-->
<!--                </button>-->
<!--                </#if>-->
              <@shiro.hasPermission name="approval:add">
                <#if (capPreApproval.approvalStatus==null||capPreApproval.approvalStatus=='1')>
                <button class="layui-btn layui-btn-normal" lay-filter="submit" lay-submit="">
                    提交
                </button>
                </#if>
             </@shiro.hasPermission>
            <@shiro.hasPermission name="approval:approval">
                <button class="layui-btn layui-btn-normal" lay-filter="approval" lay-submit="">
                    确定
                </button>
                <button class="layui-btn layui-btn-danger" lay-filter="reFill" lay-submit="">
                    返回重新填报
                </button>
            </@shiro.hasPermission>
             <@shiro.hasPermission name="approval:add">
            <#if (capPreApproval.approvalStatus=='0' || capPreApproval.approvalStatus =='1')>
                <button class="layui-btn layui-btn-danger" lay-filter="cancel" lay-submit="">
                    取消预审
                </button>
            </#if>
            </@shiro.hasPermission>


        </#if>
        <button class="layui-btn layui-btn-primary" id="close">
            关闭
        </button>
    </div>
    </div>
    <#-- 这个页面，加载一个对应的处理步骤的表信息 -->

    <!--        <table id="spendtimeList" class="layui-hide" lay-filter="user"></table>-->




</form>

</body>
<script type="text/javascript" src="${re.contextPath}/plugin/jquery/jquery-3.2.1.min.js"></script>
<script type="text/javascript" src="${re.contextPath}/plugin/layui-v2.5.4/layui/layui.js"></script>
<script type="text/javascript" src="${re.contextPath}/plugin/tools/tool.js"></script>
<script type="text/javascript" src="${re.contextPath}/plugin/tools/update-setting.js"></script>
<script type="text/html" id="serviceTypeTpl">

    {{#  layui.each(d.list, function(index, item){ }}
    <input type="radio" name="serviceTypeId" value="{{item.id}}"  title="{{item.name}}" {{item.checked==true?'checked':''}} lay-filter="serviceType" {{item.disabled==true?'disabled':''}}/>

    {{#  }); }}

    {{#  if(d.list.length === 0){ }}
    无数据
    {{#  } }}
</script>

<script type="text/html" id="approvalResultTpl">

    {{#  layui.each(d.list, function(index, item){ }}

    <input type="radio" name="approvalResult" value="{{item.dictValue}}"  title="{{item.dictName}}" {{item.checked==true?'checked':''}} {{item.disabled==true?'disabled':''}}/>

    {{#  }); }}

    {{#  if(d.list.length === 0){ }}
    无数据
    {{#  } }}
</script>
<script type="text/html" id="handleTypeTpl">
    {{#  layui.each(d.list, function(index, item){ }}
    <input type="radio" name="handleType" value="{{item.dictValue}}"  title="{{item.dictName}}"  {{item.checked==true?'checked':''}} />

    {{#  }); }}

    {{#  if(d.list.length === 0){ }}
    无数据
    {{#  } }}
</script>
<script type="text/html" id="serviceKindTpl">

    <option value=""></option>
    {{#layui.each(d.list,function(index,item){ }}
    <option  value="{{item.id}}" {{item.checked==true?'selected':''}} >{{item.name}}</option>
    {{# }); }}
    {{# if(d.list.length==0){ }}
    无数据
    {{# }}}
</script>
<script type="text/html" id="serviceIdTpl">

    <option value=""></option>
    {{#layui.each(d.list,function(index,item){ }}
    <option  value="{{item.id}}" {{item.checked==true?'selected':''}} >{{item.name}}</option>
    {{# }); }}
    {{# if(d.list.length==0){ }}
    无数据
    {{# }}}
</script>
<script type="text/html" id="documentListTpl">
    <div class="layui-collapse">
        {{#layui.each(d.list,function(index,item){ }}
        <div class="layui-colla-item">
            <h2 class="layui-colla-title">
                {{#  if(item.noneEmpty=='1'){ }}<span style="color:red">(必传项)</span>{{# }}}{{item.name}}
            </h2>
            <div class="layui-colla-content layui-show">
                <ul>
                    {{#layui.each(item.fileInfos,function(childIndex,childItem){ }}
                    <li  style="display:inline-block">
                        <div class="layui-form-item">
                            <input type="hidden" name="name{{childItem.id}}" value="{{childItem.id}}">
                            <img style="width:200px;height:200px" src="{{childItem.fileUrl}}" >
                           </div>
                        <div class="layui-form-item" id="fileStatusClick{{childItem.id}}" onclick="fileStatusClick('{{childItem.id}}')" style="text-align:center">
                            <input type="hidden" name="fileResult{{childItem.id}}" value="{{childItem.fileStatus}}">
                            {{# if(childItem.fileStatus=='1'){ }}
                            <input type="radio" name="fileStatusRadio{{childItem.id}}" title="合格" value="1" checked="checked">
                            <input type="radio" name="fileStatusRadio{{childItem.id}}" title="不合格" value="0" >
                            {{# }else if(childItem.fileStatus=='0'){ }}
                            <input type="radio" name="fileStatusRadio{{childItem.id}}" title="合格" value="1">
                            <input type="radio" name="fileStatusRadio{{childItem.id}}" title="不合格" value="0" checked="checked">
                            {{# }else { }}
                            <input type="radio" name="fileStatusRadio{{childItem.id}}" title="合格" value="1" checked="checked">{{childItem.fileStatus}}
                            <input type="radio" name="fileStatusRadio{{childItem.id}}" title="不合格" value="0">
                            {{# } }}
                        </div>
                        <div class="layui-form-item">
                            <textarea style="width:200px;height:100px;resize:none;" name="fileRemarks{{childItem.id}}">{{childItem.fileRemarks}}</textarea>
                        </div>
                        <div class="layui-form-item" style="text-align:center">
                            <button class="layui-btn" type="button" id="download{{childItem.id}}" onclick="download('{{childItem.id}}')">下载</button><button class="layui-btn" type="button" id="preview{{childItem.id}}" onclick="preview('{{childItem.id}}')">预览</button>
                        </div>
                    </li>
                    {{# }); }}
                    {{# if(item.fileInfos.length==0){ }}
                    无数据
                    {{# }}}
                </ul>

            </div>
        </div>
        {{# }); }}
        {{# if(d.list.length==0){ }}
        无数据
        {{# }}}

    </div>

</script>
<script type="text/html" id="suggestionHisTpl">
    <ul class="layui-timeline">
    {{#layui.each(d.list,function(index,item){ }}
        <li class="layui-timeline-item">
            <i class="layui-icon layui-timeline-axis"></i>
            <div class="layui-timeline-content layui-text">
                <h3 class="layui-timeline-title">
                     {{layui.util.toDateString(item.date, 'yyyy年MM月dd日 HH时mm分ss秒')}}
                </h3>
                <p>
                   {{item.approvalSuggestion}}
                </p>
            </div>
        </li>
    {{# }); }}
    {{# if(d.list.length==0){ }}
    无数据
    {{# }}}
    </ul>
</script>

<script>
 //var fileInfoArray=[];
    $(document).on('click','#approvalResult',function(){
        var val = $('input[name=approvalResult]:checked').val();
        $("#approvalResultHidden").val(val)
       if(val=='1'){
        $("#handleTypeInline").show();

       }else{
       $("input[name='handleType']:checked").prop('checked',false);
        $("#handleTypeInline").hide();
       }
        layui.form.render();
    });
    layui.use(['element','form','laytpl','util'], function(){
            var element = layui.element,form = layui.form,laytpl=layui.laytpl,util=layui.util;
            if('${capPreApproval.serviceId}' ){
                loadList('/document/getDocumentList?serviceId=${capPreApproval.serviceId}&busId=${capPreApproval.id}','documentListTpl','documentList');
            }
            if('${capPreApproval.id}'){
                loadList('/approval/getApprovalSuggestionList?id=${capPreApproval.id}','suggestionHisTpl','suggestionList');
            }
           
            function loadList(url,tplId,divId){
                $.ajax({
                    url:url,
                    dataType:'json',
                    type:'get',
                    async:false,
                    success:function(res){
                            if(res.flag){
                                var data={},list=[];
                                data.title=res.msg;

                                res.jsonObj.data.forEach(function(value,index){
                                    list.push(value);
                                },this);
                                data.list = list;
                                loadTpl(data,tplId,divId);
                            }
                    },
                beforeSend:function(){
                        console.log("pending");
                }
                });
            }
            function loadTpl(data,templateId,divId){

            var getTpl = document.getElementById(templateId).innerHTML
                            ,view = document.getElementById(divId);
            laytpl(getTpl).render(data,function(html){
                view.innerHTML=html;
            });
            element.render(divId);
            form.render();


        }
    });

  layui.use(['form','layer','laytpl','element'], function(){
    $ = layui.jquery;
    var form = layui.form,laytpl=layui.laytpl,element = layui.element;
    if('${capPreApproval.serviceTypeId}'=='601957b469524d0ab42319238c160bad'){
        $("#companyApproval").show();
    }else{
        $("#companyApproval").hide();
    }
    var approvalStatus = '${capPreApproval.approvalStatus}';

       if(approvalStatus=='0'){
             <@shiro.hasPermission name="approval:approval">
                  $("#approvalResultInfo").show();
             </@shiro.hasPermission>
       }else {
            if(approvalStatus){
               $("#approvalResultInfo").show();
            }else{
                $("#approvalResultInfo").hide();
            }
        }
        var approverRole = '${approver}';
         if(approverRole!="true"){
              if(approvalStatus=='0'|| approvalStatus=='1' || approvalStatus=='2'){
                $("#serviceKindId").attr("disabled","disabled");
                $("#serviceId").attr("disabled","disabled");
                $("#filler").attr("readonly","readonly");
                $("#companyName").attr("readonly","readonly");
                $("#phone").attr("readonly","readonly");
            }
        }else{

                 $("#serviceKindId").attr("disabled","disabled");
                $("#serviceId").attr("disabled","disabled");
                $("#filler").attr("readonly","readonly");
                $("#companyName").attr("readonly","readonly");
                $("#phone").attr("readonly","readonly");
        }
    //自定义验证规则
    form.verify({
        filler: function(value){
        if(value.trim()==""){
          return "填报人不能为空";
        }
      },
      phone:function(value){
         if(value.trim()==""){
          return "电话不能为空";
        }
      },
      serviceTypeId:function(value){
         if(value.trim()==""){
          return "业务类型不能为空";
        }
      },
      serviceKindId:function(value){
         if(value.trim()==""){
          return "业务分类不能为空";
        }
      },
      serviceId:function(value){
         if(value.trim()==""){
          return "业务名称不能为空";
        }
      }
    });
   
   $('#close').click(function(){
     var index = parent.layer.getFrameIndex(window.name);
     parent.layer.close(index);
     return false;
   });
   form.on('radio(serviceType)',function(data){

      var serviceTypeId = data.value;
      if(serviceTypeId=='601957b469524d0ab42319238c160bad'){
           $("#companyApproval").show();
      }else{
          $("#companyName").val('');
          $("#creditCode").val('');
           $("#companyApproval").hide();
      }
      $.ajax({
          url:"/kind/getKindList",
          data:{
            serviceTypeId:serviceTypeId
          },
          type:"get",
          dataType:"json",
          success:function(res){
              if(res.flag){
               $("#serviceKindId").empty();
               $("#serviceId").empty();
                $("#documentList").empty();
                   var html="<option></option>";
                   $(res.jsonObj.data).each(function(v,k){
                      html+="<option value='"+k.id+"'>"+k.name+"</option>";
                    });
                $("#serviceKindId").append(html);
<!--                form.render('select(serviceKind)');-->
                 element.render('serviceKind');
                 form.render();
              }
          },
          error:function(){
            console.log("error");
          }

        });
   });
   form.on('select(serviceKind)',function(data){
            var serviceKindId = data.value;
    $.ajax({
            url:"/service/getServiceList",
          data:{
            serviceKindId:serviceKindId
          },
          type:"get",
          dataType:"json",
          success:function(res){
              if(res.flag){
               $("#serviceId").empty();
               $("#documentList").empty();
                   var html="<option></option>";
                   $(res.jsonObj.data).each(function(v,k){
                      html+="<option value='"+k.id+"'>"+k.name+"</option>";
                    });
                $("#serviceId").append(html);
                form.render('select');
              }
          },
          error:function(){
            console.log("error");
          }

        });

   });
     form.on('select(serviceId)',function(data){
            var serviceId = data.value;
<!--            alert(serviceId);-->
            $("#serviceIdHidden").val(serviceId);
            $.ajax({
                url:"/document/getDocumentList",
                data:{
                    serviceId:serviceId,
                    busId:null
                },
                type:"get",
                dataType:"json",
                success:function(res){
                    if(res.flag){
                    $("#serviceId").empty();
                        console.log(res.jsonObj.data);
                        var html="";
                        $("#documentList").empty();
                        $(res.jsonObj.data).each(function(index,item){
                            html+= `<div class="layui-collapse">
                                    <div class="layui-colla-item">
                                        <h2 class="layui-colla-title">`;
                                         
                                           if(item.noneEmpty=='1'){
                                             html+=`<span style="color:red">(必传项)</span>`;
                                           } 
                                         html+= item.name;


                                     html+=`</h2>`
                                     html+= `<div class="layui-colla-content layui-show">
                                                 <div class="layui-upload">
                                                    <button type="button" class="layui-btn" id="test2">多图片上传</button>
                                                    <blockquote class="layui-elem-quote layui-quote-nm" style="margin-top: 10px;">
                                                        预览图：
                                                    <div class="layui-upload-list" id="demo2"></div>
                                                    </blockquote>
                                                 </div>
                                            <div>
                                        </div>
                                    </div>`;
                        });
                        $("#documentList").append(html);

                        element.render('documentList');
<!--                        alert($("#serviceIdHidden").val())-->
<!--                        form.render('select');-->

                      
                    }
                },
                error:function(){
                    console.log("error");
                }

                });

   });
       //监听提交
    form.on('submit(save)', function(data){
<!--       alert($("#serviceIdHidden").val())-->
       data.field.saveActionFlag='';
<!--        console.log(data.field);-->
<!--          layerAjax('add',data.field,'approvalList');-->
       return false;

    });
    form.on('submit(submit)', function(data){
<!--         alert($("#serviceIdHidden").val())-->
       data.field.saveActionFlag='0';
<!--        data.field.sysFileInfoList =getDynAttr();-->
<!--        console.log(data.field);-->
          layerAjax('add',data.field,'approvalList');
       return false;

    });
 form.on('submit(reFill)', function(data){
       data.field.saveActionFlag='1';
       var fileInfoListArray = getDynAttr();
         var fileInfoList = JSON.stringify(fileInfoListArray);
<!--        console.log(fileInfoList);-->

            $.ajax({
                url:"/sysFile/batchUpdateFile",
                data:fileInfoList,
                type:"post",
                dataType:"json",
                contentType:"application/json",
                success:function (res) {
                      if(res.flag){
                        layerAjax('add',data.field,'approvalList');


                      }
                },
                error:function(){
                        layui.layer.msg("系统异常");
                }
            });

       return false;

    });
     form.on('submit(cancel)', function(data){
       data.field.saveActionFlag='3';
        console.log(data.field);
          layerAjax('add',data.field,'approvalList');
       return false;

    });
      form.on('submit(forceEnd)', function(data){
           data.field.saveActionFlag='3';
            console.log(data.field);
<!--              layerAjax('add',data.field,'approvalList');-->
           return false;
        });
     form.on('submit(noPass)', function(data){
       data.field.saveActionFlag='2';
        console.log(data.field);
<!--          layerAjax('add',data.field,'approvalList');-->
       return false;
    });
     form.on('submit(approval)', function(data){
      var checkVal = $('input[name=approvalResult]:checked').val();
      if(checkVal=='1'){
      //预审通过（流程结束 ）
        data.field.saveActionFlag='2';
      }else{
      //预审不通过（流程结束）
        data.field.saveActionFlag='3';
      }
<!--      console.log( $("textarea[name^='fileRemarks']"));-->
<!--       data.field.sysFileInfoList =getDynAttr();-->
          layerAjax('add',data.field,'approvalList');
       return false;
    });


      if('${capPreApproval.serviceTypeId}'){
            loadSelect('/kind/getKindList?serviceTypeId=${capPreApproval.serviceTypeId}','serviceKindTpl','serviceKindId','${capPreApproval.serviceKindId}','id');
      }
      if('${capPreApproval.serviceKindId}'){
            loadSelect('/service/getServiceList?serviceKindId=${capPreApproval.serviceKindId}','serviceIdTpl','serviceId','${capPreApproval.serviceId}','id');
      }
    loadSelect('/dict/loadDict?dictType=approval_result','approvalResultTpl','approvalResult','${capPreApproval.approvalResult}','dictValue');
    loadSelect('/dict/loadDict?dictType=handle_type','handleTypeTpl','handleType','${capPreApproval.handleType}','dictValue');
    loadSelect('/type/loadAllServiceType','serviceTypeTpl','serviceTypeId','${capPreApproval.serviceTypeId}','id');



    function loadSelect(url,templateId,divId,singleVal,val){
        $.ajax({
           url:url,
           type:'get',
            async: false,
           success:function(res){
                if(res.flag){
                    var data={},list=[];
                    data.title=res.msg;
                    var approvalRole = '${approver}';
                    var approvalStatus='${capPreApproval.approvalStatus}';
                    if(approvalRole=="false" && (approvalStatus=='0' || approvalStatus=='1' || approvalStatus=='2')){

                       res.jsonObj.data.forEach(function(value,index){
                        if(value[val]==singleVal){
                         value.checked=true;
                         list.push(value);
                        }else{
                          list.push(value);
                        }
                        value.disabled=true;

                     },this);
                    }else{
                     res.jsonObj.data.forEach(function(value,index){
                        if(value[val]==singleVal){
                         value.checked=true;
                         list.push(value);
                        }else{
                          list.push(value);
                        }

                     },this);
                    }

                     data.list = list;
                    loadTpl(data,templateId,divId);
                }
           },
           beforeSend:function(){
               console.log("pending");
           }
        })
  }

    function loadTpl(data,templateId,divId){

        var getTpl = document.getElementById(templateId).innerHTML
                        ,view = document.getElementById(divId);
        laytpl(getTpl).render(data,function(html){
            view.innerHTML=html;
        });
        form.render();


    }


  });

     function fileStatusClick(fileId){
        var fileStatusVal = $("input[name='fileStatusRadio"+fileId+"']:checked").val();
           $("input[name='fileResult"+fileId+"'").val(fileStatusVal);
<!--           alert( $("input[name='fileResult"+fileId+"'").val());-->
<!--        if(fileStatusVal=='0'){-->
<!--            $("input[name='handleType']:checked").prop('checked',false);-->
<!--            $("#handleTypeInline").hide();-->
<!--            $("input[name='approvalResult'][value='0']").prop('checked',true);-->
<!--             layui.form.render();-->

<!--        }else{-->
<!--             $("input[name='approvalResult'][value='1']").prop('checked',true);-->
<!--             $("#handleTypeInline").show();-->
<!--              layui.form.render();-->
<!--        }-->
    }

    function download(fileId){
        layui.layer.msg('功能正在开发ing,敬请期待');
        return false;
    }



    function preview(fileId){
        layui.layer.msg('功能正在开发ing，敬请期待');
        return false;
    }
    //根据动态创建的对象获取相应的值
    //$("textarea[name^='fileRemarks']").length

    function getDynAttr(){
        var fileInfoArray=new Array();
        for(var i=0; i<$("textarea[name^='fileRemarks']").length; i++){
          var fileInfo={};
          var textareaName= $("textarea[name^='fileRemarks']")[i].name;
          var textareaValue=$("textarea[name^='fileRemarks']")[i].value;
          var radioValue=$("input[name^='fileResult']")[i].value;
          fileInfo.id=textareaName.replace('fileRemarks','');
          fileInfo.fileRemarks=textareaValue;
          fileInfo.fileStatus=radioValue
          fileInfoArray.push(fileInfo);
        }
        return fileInfoArray;
    }

</script>
</html>
